<?php

namespace app\web\controller;
use app\web\model\AssessModel;
use app\common\controller\StoreBaseController;
use think\Db;
/**
 *评价表
 */
class AssessController extends StoreBaseController
{
 	 protected $model;
	
    protected function _initialize() {
        parent::_initialize();
        $this->model = new AssessModel();
    }
    /**
     * 评价列表
     * @author [longx] 
     */
    public function index( $page = 1){
    	$map['agent_id'] = session('storeInfo')['id'];
    	
		if(request()->isPost()){
		 	$param = input('post.');
			if($param['goodsname']){
				$map['goods_name'] = ['like', '%'.$param['goodsname'].'%'];
			}				
		 }
        $list = Db::name('mall_assess')->where($map)->paginate(10);
        return $this->fetch('index', ['list' => $list]);
    }

    /**
     * [del删除]
     * @author [longx] 
     */
    public function delete()
    {
        $id = input('param.id');
        if ($this->model->destroy($id)) {
            $this->success('删除成功');
        } else {
            $this->error('删除失败');
        }
    }
	
	 /**
     * [reply回复]
     * @author [longx] 
     */
    public function reply()
    {

    }
}